function batchImport() {
    var formData = new FormData();
    formData.append('filename', $('#imporExcelFile')[0].files[0]);
    $.ajax({
        url:"/caicai/batchImport",
        type:"POST",
        data:formData,
        processData:false,
        contentType:false,
        success:function(data){
            alert(data);
            window.location.href="work.html";
        },
        error:function(e){
            alert("错误！！");
        }
    });
}

function exportExcel(type) {
    /*var formData = new FormData();
    formData.append('type',type);
    formData.append('startDate',$('#startDate').val());
    formData.append('endDate',$('#endDate').val());
    formData.append('month',$('#month').val());
    */
    var para = "type="+type+"&startDate="+$('#startDate').val()+"&endDate="+$('#endDate').val()+"&month="+$('#month').val();
    window.location.href="/caicai/exportExcel?"+para;
}

$(document).ready(function(){
    $('#startDate').dcalendarpicker({format: 'yyyy-mm-dd'}); //初始化日期选择器
    $('#endDate').dcalendarpicker({format: 'yyyy-mm-dd'}); //初始化日期选择器
    $('#month').dcalendarpicker({format: 'yyyy-mm'}); //初始化日期选择器
    //$('#mycalendar').dcalendar({format: 'yyyy-mm'}); //初始化日历
});
function downloadTemplate(){
    window.location.href="/caicai/Template.xlsx";
}